//
//  TravelViewController.m
//  chanyouji
//
//  Created by xiacheng on 16/8/17.
//  Copyright © 2016年 chanyouji. All rights reserved.
//

#import "TravelViewController.h"
#import "AFNetworking.h"

@interface TravelViewController ()

@end

@implementation TravelViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    

    [self _loadData];
    
    
    
}

// 解析 json 数据
-(void)_loadData{

    
    AFHTTPSessionManager *manager =[AFHTTPSessionManager manager];
    
    
    NSString * url =@"http://q.chanyouji.com/api/v1/timelines.json?interests=&page=1&per=50";
    
    [manager GET:url parameters:NULL success:^(NSURLSessionDataTask *task, id responseObject) {
        
        
        NSArray * data=responseObject[@"data"];
      
        for (int i; i<data.count; i++) {
            
            NSDictionary *dic =data[i];
            
            NSDictionary *userDic=dic[@"user"];
            
           // TravelModel *model =[TravelModel yy_modelWithDictionary:userDic];
            
            
            
        }
        
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        
    }];
    


}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
